package Athena;

use 5.00503;
use strict;
use Carp;
use CGI;
$CGI::POST_MAX=1024 * 100; # 100k limit
$CGI::DISABLE_UPLOADS = 1; # no files

require Exporter;
require DynaLoader;
use AutoLoader;
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS $AUTOLOAD);
@ISA = qw(Exporter
	DynaLoader);

# Items to export into callers namespace by default. Note: do not export
# names by default without a very good reason. Use EXPORT_OK instead.
# Do not simply export all your public functions/methods/constants.

# This allows declaration	use Athena ':all';
# If you do not need this, moving things directly into @EXPORT or @EXPORT_OK
# will save memory.
%EXPORT_TAGS = ( 'all' => [ qw(
	ATH_ALGO_CPU
	ATH_ALGO_CU0
	ATH_ALGO_CU1
	ATH_ALGO_CU2
	ATH_ALGO_CU3
	ATH_ALGO_CU4
	ATH_ALGO_CU5
	ATH_ALGO_CU6
	ATH_ALGO_CU7
	ATH_ALGO_CU8
	ATH_ALGO_CU9
	ATH_ALGO_DIS
	ATH_ALGO_DYN
	ATH_ALGO_FIELDS
	ATH_ALGO_LOD
	ATH_ALGO_MAXEX
	ATH_ALGO_MEM
	ATH_ALGO_NET
	ATH_ALGO_NON
	ATH_ALGO_ROR
	ATH_ALGO_SIM
	ATH_ALGO_TYPES
	ATH_CASE_ADD_P
	ATH_CASE_ALGO
	ATH_CASE_CHOSEN
	ATH_CASE_DURL
	ATH_CASE_ESC
	ATH_CASE_EXPECT
	ATH_CASE_E_PATH
	ATH_CASE_FARM
	ATH_CASE_FMT
	ATH_CASE_F_MEMB
	ATH_CASE_F_NAME
	ATH_CASE_HITADDS
	ATH_CASE_IN
	ATH_CASE_MTIME
	ATH_CASE_NOMINA
	ATH_CASE_ON
	ATH_CASE_OURL
	ATH_CASE_PHYS
	ATH_CASE_P_HOST
	ATH_CASE_P_MEMB
	ATH_CASE_REM_P
	ATH_CASE_RTTL
	ATH_CASE_SERIAL
	ATH_CASE_SPC
	ATH_CASE_STATS
	ATH_CASE_TTL
	ATH_CASE_UP
	ATH_CASE_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H_READ_WRITE
	ATH_UP
);

$VERSION = '0.01';

sub AUTOLOAD {
    # This AUTOLOAD is used to 'autoload' constants from the constant()
    # XS function.

    my $constname;
    ($constname = $AUTOLOAD) =~ s/.*:://;
    croak "&Athena::constant not defined" if $constname eq 'constant';
    my ($error, $val) = constant($constname);
    if ($error) { croak $error; }
    {
	no strict 'refs';
	# Fixed between 5.005_53 and 5.005_61
#XXX	if ($] >= 5.00561) {
#XXX	    *$AUTOLOAD = sub () { $val };
#XXX	}
#XXX	else {
	    *$AUTOLOAD = sub { $val };
#XXX	}
    }
    goto &$AUTOLOAD;
}

bootstrap Athena $VERSION;

# Preloaded methods go here.

use CGI;

use Athena::WebAPI::Request;

use Athena::AuthInAction;

sub main {
  my $rRequest = Request->new();
  my $rResponse = undef;


  # this is done this way so that at some future point 
  # we can do our own auth if desired
  $rResponse = AuthInAction->execute($rRequest);
  $rRequest->reply($rResponse);
}
  

sub test {
  print "athena perl test ok\n";
}

# Autoload methods go after =cut, and are processed by the autosplit program.

1;
__END__
# Below is stub documentation for your module. You'd better edit it!

=head1 NAME

Athena - Perl extension for blah blah blah

=head1 SYNOPSIS

  use Athena;
  blah blah blah

=head1 DESCRIPTION

Stub documentation for Athena, created by h2xs. It looks like the
author of the extension was negligent enough to leave the stub
unedited.

Blah blah blah.

=head2 EXPORT

None by default.

=head2 Exportable constants

  ATH_ALGO_CPU
  ATH_ALGO_CU0
  ATH_ALGO_CU1
  ATH_ALGO_CU2
  ATH_ALGO_CU3
  ATH_ALGO_CU4
  ATH_ALGO_CU5
  ATH_ALGO_CU6
  ATH_ALGO_CU7
  ATH_ALGO_CU8
  ATH_ALGO_CU9
  ATH_ALGO_DIS
  ATH_ALGO_DYN
  ATH_ALGO_FIELDS
  ATH_ALGO_LOD
  ATH_ALGO_MAXEX
  ATH_ALGO_MEM
  ATH_ALGO_NET
  ATH_ALGO_NON
  ATH_ALGO_ROR
  ATH_ALGO_SIM
  ATH_ALGO_TYPES
  ATH_CASE_ADD_P
  ATH_CASE_ALGO
  ATH_CASE_CHOSEN
  ATH_CASE_DURL
  ATH_CASE_ESC
  ATH_CASE_EXPECT
  ATH_CASE_E_PATH
  ATH_CASE_FARM
  ATH_CASE_FMT
  ATH_CASE_F_MEMB
  ATH_CASE_F_NAME
  ATH_CASE_HITADDS
  ATH_CASE_IN
  ATH_CASE_MTIME
  ATH_CASE_NOMINA
  ATH_CASE_ON
  ATH_CASE_OURL
  ATH_CASE_PHYS
  ATH_CASE_P_HOST
  ATH_CASE_P_MEMB
  ATH_CASE_REM_P
  ATH_CASE_RTTL
  ATH_CASE_SERIAL
  ATH_CASE_SPC
  ATH_CASE_STATS
  ATH_CASE_TTL
  ATH_CASE_UP
  ATH_CASE_URLESC
  ATH_DOWN
  ATH_EOA
  ATH_FARM_HARDMAX
  ATH_MUXS_HARDMAX
  ATH_NAME_MAX
  ATH_OFF
  ATH_ON
  ATH_OPN
  ATH_PHYS_HARDMAX
  ATH_READ_ONLY
  ATH_READ_WRITE
  ATH_UP



=head1 SEE ALSO

Mention other useful documentation such as the documentation of
related modules or operating system documentation (such as man pages
in UNIX), or any relevant external documentation such as RFCs or
standards.

If you have a mailing list set up for your module, mention it here.

If you have a web site set up for your module, mention it here.

=head1 AUTHOR

Mark, E<lt>mark@tek.eease.comE<gt>

=head1 COPYRIGHT AND LICENSE

Copyright (C) 2004 by Mark

This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself, either Perl version 5.8.3 or,
at your option, any later version of Perl 5 you may have available.


=cut
